bookingsBusiness: getStaffAvailability

Namespace: microsoft.graph

Get the availability information of staff members of a Microsoft Bookings calendar.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) Not supported. Not supported.
Delegated (personal Microsoft account) Not supported. Not supported.
Application Bookings.Read.All Bookings.Manage.All, Bookings.ReadWrite.All, Calendars.Read, Calendars.ReadWrite

HTTP request

POST /solutions/bookingBusinesses/{id}/getStaffAvailability

Request headers

Name Description
Authorization Bearer {code}. Required.
Content-Type application/json. Required.

Request body

In the request body, pass the list of staff IDs along with two other parameters of dateTimeTimeZone resource type called startDateTime and endDateTime. These correspond to the two timestamps between which the staff availability will be returned.

Response

If successful, this method returns a 200 OK response code and a staffAvailabilityItem collection in the response.

Example

Request

The following example shows a request.

POST https://graph.microsoft.com/v1.0/solutions/bookingBusinesses/Contosolunchdelivery@contoso.com/getStaffAvailability
Content-Type: application/json

{
    "staffIds": [
        "311a5454-08b2-4560-ba1c-f715e938cb79"
    ],
    "startDateTime": {
        "dateTime": "2022-01-25T00:00:00",
        "timeZone": "India Standard Time"
    },
    "endDateTime": {
        "dateTime": "2022-01-26T17:00:00",
        "timeZone": "Pacific Standard Time"
    }
}

Response

The following example shows the response.

HTTP/1.1 200 OK
Content-type: application/json

{
    "staffAvailabilityItem": [
        {
            "staffId": "311a5454-08b2-4560-ba1c-f715e938cb79",
            "availabilityItems": [
                {
                    "status": "Available",
                    "startDateTime": {
                        "dateTime": "2022-01-24T08:00:00",
                        "timeZone": "(UTC-08:00) Pacific Time (US & Canada)"
                    },
                    "endDateTime": {
                        "dateTime": "2022-01-24T15:00:00",
                        "timeZone": "(UTC-08:00) Pacific Time (US & Canada)"
                    },
                    "serviceId": ""
                },
                {
                    "status": "Busy",
                    "startDateTime": {
                        "dateTime": "2022-01-24T15:00:00",
                        "timeZone": "(UTC-08:00) Pacific Time (US & Canada)"
                    },
                    "endDateTime": {
                        "dateTime": "2022-01-24T16:00:00",
                        "timeZone": "(UTC-08:00) Pacific Time (US & Canada)"
                    },
                    "serviceId": "57da6774-a087-4d69-b0e6-6fb82c339976"
                },
                {
                    "status": "Available",
                    "startDateTime": {
                        "dateTime": "2022-01-24T16:00:00",
                        "timeZone": "(UTC-08:00) Pacific Time (US & Canada)"
                    },
                    "endDateTime": {
                        "dateTime": "2022-01-24T17:00:00",
                        "timeZone": "(UTC-08:00) Pacific Time (US & Canada)"
                    },
                    "serviceId": ""
                },
                {
                    "status": "Available",
                    "startDateTime": {
                        "dateTime": "2022-01-25T08:00:00",
                        "timeZone": "(UTC-08:00) Pacific Time (US & Canada)"
                    },
                    "endDateTime": {
                        "dateTime": "2022-01-25T17:00:00",
                        "timeZone": "(UTC-08:00) Pacific Time (US & Canada)"
                    },
                    "serviceId": ""
                },
                {
                    "status": "Available",
                    "startDateTime": {
                        "dateTime": "2022-01-26T08:00:00",
                        "timeZone": "(UTC-08:00) Pacific Time (US & Canada)"
                    },
                    "endDateTime": {
                        "dateTime": "2022-01-26T17:00:00",
                        "timeZone": "(UTC-08:00) Pacific Time (US & Canada)"
                    },
                    "serviceId": ""
                }
            ]
        }
    ]
}